<?php
/*
  $Id: featured.php,v 1.1.1.1 2004/03/04 23:42:14 ccwjr Exp $

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2002 osCommerce

  CRE Loaded , Open Source E-Commerce Solutions
  http://www.creloaded.com
 
  Chain Reaction Works, Inc
  Portions: Copyright &copy; 2005 - 2006 Chain Reaction Works, Inc.
 	
 	Last Modified by $Author$
 	Last Modifed on : $Date$
 	Latest Revision : $Revision: 1075 $


  Released under the GNU General Public License
*/
?>
<!-- featured //-->
<?php
  if ($random_product = tep_random_select("select featured_id from  " . TABLE_FEATURED . " where status = '1' order by featured_date_added DESC limit " . MAX_RANDOM_SELECT_SPECIALS)) {


          $random_product_query21 = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_image, p.products_price, p.products_tax_class_id, p.products_date_added from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_FEATURED . " f where f.featured_id ='" .  $random_product['featured_id'] . "' and f.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and p.products_status = '1'");

while ($random_product21 = tep_db_fetch_array($random_product_query21)){


$specials_price_box = tep_get_products_special_price($random_product21['products_id']);
?>
          <tr>
            <td class="product">
<?php



  	$box_img = tm_image_border('<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product21['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $random_product21['products_image'], $random_product21['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'class="pic"') . '</a><br />');
	
	$box_name = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $random_product21['products_id']) . '">' . $random_product21['products_name'] . '</a>';

	$box_desc = substr($random_product21['products_description'], 0, MAX_DESC_BOX) . '...';
	
	if ($specials_price_box) {
		
    	$box_price =  '<s>' . $currencies->display_price($random_product21['products_price'], tep_get_tax_rate($random_product21['products_tax_class_id'])) . '</s>' . PRICE_SEPARATOR_BOX . '<span class="productSpecialPrice">' . $currencies->display_price($specials_new_products_price1, tep_get_tax_rate($random_product21['products_tax_class_id'])) . '</span>';
	
    } else {
		
    	$box_price =  '<span class="productSpecialPrice">' . $currencies->display_price($random_product21['products_price'], tep_get_tax_rate($random_product21['products_tax_class_id'])) . '</span>';
    
	}


    $info_box_contents = array();
    $info_box_contents[] = array('align' => 'left',
                                 'text'  => '<font color="' . $font_color . '">' . BOX_HEADING_FEATURED . '</font>'
                                );
    new infoBoxHeading_5($info_box_contents,  false, false, tep_href_link(FILENAME_FEATURED_PRODUCTS, '', 'NONSSL'));

    $info_box_contents = array();
    $info_box_contents[] = array('align' => 'center',
						'text'  => '
						
								 	' . $box_img . '
								 	<br style="line-height:18px">
								 	' . $box_name . '<br />
									<br style="line-height:14px" />
									' . $box_price . '<br />

');



   new infoBox_5($info_box_contents);

$info_box_contents = array();
  $info_box_contents[] = array('align' => 'left',
                                'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
                              );
//  new infoboxFooter($info_box_contents, true, true);
?>
            </td>
          </tr>
<?php
  }
 }
?>
<!-- featured_eof //-->
